package com.xyzq.cgate.admin.web;

import com.xyzq.cgate.common.response.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @author chenchen
 * @date 2019/6/10 10:32
 */
@RestController
@RequestMapping("/admin/admin")
public class AdminController {

    @GetMapping("info")
    public Mono<ResponseEntity> info(String token){
        Map<String, Object> data = new HashMap<>();
        data.put("name", "admin");
        data.put("avatar", "avatar1");
        List<String> roles = new ArrayList<>();
        roles.add("admin");
        data.put("roles", roles);
        data.put("introduction", "admin introduction");
        return Mono.create(sink -> sink.success(new ResponseEntity().success(data)));
    }
}
